<template>
	<view>
	<cu-custom :isBack="true">
		<block slot="backText"></block>
		<block slot="content">{{corpCode}}-上传图片</block>
	</cu-custom>
	<view class="content" style="display: flex;flex-direction: column;justify-content: space-between; " :style="[{height:'calc(100vh - '+ 0 + '50px )'}]">
		<view style="background-color: #fff;padding: 0 20px;">
			
			<uni-upoad-images :length="9999" :bizKey="soCode"  :url="uploadurl" :imageIdslist="imageIdlist" :imgArray="imgArray" ref="child" :bizType="bizType"></uni-upoad-images>
		</view>
		<!-- <button class="add-btn" type="primary" style="margin: 20px;"  @click="confirm">确认上传</button> -->
	</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex';
	import uniUpoadImages from '@/components/upload-images.vue'
	export default {
		name:'wechat',
		props: {
			scrollHeight:{ 
				type:String,
				default:"600px"
			}
		},
		components:{
			uniUpoadImages,
		},
		data() {
			return {
				CustomBar: this.CustomBar, //滚动定位用
				soCode:'',
				imgArray: [],
				uploadurl: '',
				imageIdlist :[],
				delImageIds :[],
				bizType : 'soPickChinaH_file',
				// bizType : 'soLogistics_image',
			}
		},
		onShow() {
			
		},
		onLoad(data) {
			this.uploadurl = this.serverURL_a + '/so/app/fileuplaod/upload';
			// this.uploadurl = this.serverURL_a + '/sys/app/fileUpload/upload.json';
			
			this.soCode = data.soCode
			uni.request({
				url:this.serverURL_a+'/so/app/fileuplaod/fileList',
				data:{
					bizKey : this.soCode,
					bizType:'soPickChinaH_file',
					__sid:this.userInfo.sessionid
				},
				header: {
					'content-type': 'application/x-www-form-urlencoded;charset=utf-8',
				},
				method: 'POST',
				success:function(data){
					console.log(data);
					data.data.forEach(item=>{
						this.imgArray.push({
							filePath:this.serverURL+'/'+item.fileUrl,
							createBy:item.createBy,
							createByName:item.createByName,
							createDate:item.createDate,
							id:item.id,
						})
					})
					
				}.bind(this),
				fail:function(){
					this.$api.msg('服务已停止,请稍后再试');
					return;
				}.bind(this),
			});
			
			
		},
		computed: {
			...mapState(['hasLogin', 'userInfo', 'auditlist', 'corpCode']),
		},
		methods:{
			
		}
	}
</script>

<style scoped lang="less">
	
	.cu-dialog{
		    height: 300px;
		    overflow: auto;
	}
	.content{
		padding-top: 10rpx;
		.progress,.firend_operate{
			padding: 0 10rpx;
		}
		.progress{
			margin-bottom: 20rpx;
		}
		.friend_operate{
			overflow: scroll;
			flex: 1;
			padding: 30rpx 20rpx;
			.title{
				text-align:left;
				margin-bottom: 30rpx;
				font-size: 40rpx;
			}
			.trend_title{
				text-align: right;
				font-size: 22rpx;
				color: #ff9900;
				margin-top: 50rpx;
			}
		}
	}
	
	.ly-search {
		margin: 0 30rpx;
		margin-top: 40rpx;
		padding-bottom: 15rpx;
		border-bottom: 1px solid #ededed;
	}
	.container {
		padding: 20rpx 0 50rpx 0;
	}
	
	.tui-line-cell {
		width: 100%;
		box-sizing: border-box;
		display: flex;
		align-items: center;
	}
	
	.tui-title {
		line-height: 32rpx;
		min-width: 120rpx;
		flex-shrink: 0;
	}
	
	.tui-input {
		font-size: 32rpx;
		color: #333;
		padding-left: 20rpx;
		flex: 1;
		overflow: visible;
	}
	
	.radio-group {
		margin-left: auto;
		transform: scale(0.8);
		transform-origin: 100% center;
		flex-shrink: 0;
	}
	
	.tui-radio {
		display: inline-block;
		padding-left: 28rpx;
		font-size: 36rpx;
		vertical-align: middle;
	}
	
	
	.tui-btn-box {
		padding: 40rpx 50rpx;
		box-sizing: border-box;
	}
	
	.tui-button-gray {
		margin-top: 30rpx;
	}
	
	.tui-tips {
		padding: 30rpx;
		color: #999;
		font-size: 24rpx;
	}
	
	.d-container {
		width: 400rpx;
		padding: 80rpx 30rpx;
	}
	
	.usingtext{
		margin-left: 30rpx;
		color: #999;
	}
	
	.tui-right {
		margin-left: auto;
		padding-right: 30rpx;
		color: #999;
	}
	
	.numtext{
		text-align: center;
	}
</style>

